#!/usr/bin/env python2.7
# -*- coding:utf-8 -*- 

# calibrate_depots.py

import os, sys
from metlib.kits import *
from depot.models import *

def run():
    try:
        depots = Depot.objects.all()
        for dep in depots:
            print "Calibrating Depot %s:" % dep.name
            old_size = dep.used_size_in_G
            dep.update_used_size()
            new_size = dep.used_size_in_G
            print "    old: %s G, new: %s G" % (old_size, new_size)
    except Exception as e:
        print e

